package org.shangda.wechat.pet.web.vo;

import lombok.Data;
import lombok.ToString;

import java.util.List;

/**
 * @author barry
 * @company D1M
 * @create 2020-07-14 2:42 下午
 **/
@Data
@ToString
public class BasePage<T> {
    private List<T> result;
    private Integer pageSize;
    private Integer pageNum;
    private long pageCount;
    private long count;

    public BasePage(List<T> result, Integer pageSize, Integer pageNum, long count){
        this.result = result;
        this.pageSize = pageSize;
        this.pageNum = pageNum;
        this.count = count < 0 ? 0 : count;
        this.pageCount = count%pageSize>0?count/pageSize+1:count/pageSize;
    }
}
